package com.cans.dto;

/**
 * 标准数据传输类
 *
 * @author cans
 * @date 2018/3/4
 */
public class CansResult<T> {

    /**
     * 响应类型 0: 成功 1:失败
     */
    private Integer resCode;
    /**
     * 错误信息
     */
    private String errMeg;
    /**
     * 携带数据
     */
    private T data;

    /**
     * 成功方法
     *
     * @return
     */
    public static CansResult newSuccess() {

        CansResult res = new CansResult();
        res.setResCode(1);

        return res;
    }

    public Integer getResCode() {
        return resCode;
    }

    public void setResCode(Integer resCode) {
        this.resCode = resCode;
    }

    public String getErrMeg() {
        return errMeg;
    }

    public void setErrMeg(String errMeg) {
        this.errMeg = errMeg;
    }

    public T getData() {
        return data;
    }

    public void setData(T data) {
        this.data = data;
    }
}
